import Vue from 'vue'
import Router from 'vue-router'
import ContentInfo from '@/components/ContentInfo'
// 导入问答空间相关组件
import quesList from '@/components/list/index'
// 使用vueRouter
Vue.use(Router)
export default new Router({
    mode: 'history',
    routes:[
        {
            // 路由跳转路径
            path:'/content',
            //路由名称
            name:"ContentInfo",
            //路由跳转组件
            component:ContentInfo
        },
        {
            // 问答空间列表
            path: '/ques/list',
            name: 'quesList',
            component: quesList
        },
        {
            // 问题详情页
            path: '/ques/detail',
            name: 'quesDetail',
            component: () => import('@/components/detail/index')
        },
        {
            // 二级回答页面
            path: '/answer/detail',
            name: 'answerDetail',
            component: () => import('@/components/answer/index')
        },
        {
            // 提问页面
            path: '/ques/ask',
            name: 'quesAsk',
            // 使用懒加载方式导入组件
            component: () => import('@/components/ask/index')
        },
        {
            // 默认重定向到问答列表
            path: '',
            redirect: '/ques/list'
        }
    ]
})
